<?php
include("system/core/sessions.class.php");
include("system/users/userAccess.class.php");
include("system/db/dbconnect.class.php");
include("system/display/navdisplay.class.php");
include("system/config/config.php");
$sess = new Session();
include("system/cart/cart.class.php");
$CART = new Cart();
$nav = new Navdisplay();
$user = new userAccess();
$user->isLoggedIn(1);

include("system/display/genericdisplay.class.php");
$genDisplay = new Genericdisplay();
$headerImage = $genDisplay->displayHeaderImage();


include("system/display/frontpage.class.php");
$frontPromo = new frontPromo();

if (isset($_POST['submit'])) {
	if (!$_POST['nameOfPromotion']) {
	
	} else {
		$promo = $_POST['nameOfPromotion'];
	
		$to = "carl@caramba-marketing.co.uk";
		$subject = "Promotional Idea from OCS";
		$message = "Hey Carl, you've got a promotional idea\nFrom: ".$_SESSION['realname']."\nTheir idea was: ".$promo."\nTheir LOB is ".$_SESSION['lob'];
		
		mail($to, $subject, $message);
	}
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-16" />
		<meta name="description" content="" />
		<title>
			<?php echo SITENAME ?> Toolbox
		</title>
		<meta http-equiv="content-type" content="text/html; charset=utf-16" />
<style type="text/css" media="screen">
/*<![CDATA[*/
 @import "styles/mainstyle.css"; 
/*]]>*/
</style>
<?php
        if (isset($_SESSION['lob'])){
        echo ("<link rel=\"stylesheet\" type=\"text/css\" href=\"styles/".$lob.".css\" />");
        }
?>



<link href="styles/dropdown/dropdown.css" media="all" rel="stylesheet" type="text/css" />
<link href="styles/dropdown/dropdown.vertical.css" media="all" rel="stylesheet" type="text/css" />
<link href="styles/dropdown/themes/default/default.css" media="all" rel="stylesheet" type="text/css" />

<!--[if lt IE 7]>
<script type="text/javascript" src="js/jquery/jquery.js"></script>
<script type="text/javascript" src="js/jquery/jquery.dropdown.js"></script>
<![endif]-->

<!--[if IE]>
<link rel="stylesheet" type="text/css" href="styles/ie.css" />
<![endif]-->
</head>

	<body>
		<div id="wrapper">
			<div id="header">
				<div id="homelink">
					<a href="home.php">
						home
					</a>
					<a href="contact.php">
						contact
					</a>
					<a href="howtouse.php">
						how to use</a>
				</div>
				<div id="welcomeMessage">
					<p>
						Welcome <?php echo $_SESSION['realname']; ?> <a href="logout.php"> (logout)</a>
					</p>
				</div>
				<img src="images/<?php echo $headerImage;?>" alt="" width="1000"/>
			</div>
					<?php
                    echo $CART->showMiniCart($_SESSION['username']);
                    ?>
			
				<?php
				echo $nav->buildNavigation();
				?>
			
			<div id="content">
			<h1>Build your Own</h1>
			
			<div style="width: 250px; height: 200px; float: right; margin-top: -190px;">
				<h2>How to use</h2>
				<p>Had a great idea for a promotion? Then we want to hear from you!</p>
				<p>Type your promotional idea into the text box and click the submit button</p>
				<p>Your idea will wing it's way to us and we'll consider it for inclusion on your OCS Toolbox!</p>
			</div>
			
			<p>
			<?php
			$html = "";
			
			if (isset($_POST['submit'])) {
				echo "Thanks for your promotional idea!";
			} else {
			
				$html .= "<h2>Enter the description of your promotion idea</h2>";
			
				$html .= "<form method=\"post\">";
					$html .= "<textarea rows=\"15\" cols=\"60\" name=\"nameOfPromotion\"></textarea><br />";
					$html .= "<input type=\"submit\" name=\"submit\" value=\"Submit\" />";
				$html .= "</form>";
				echo $html;
			}
			?>
			</p>
			
			</div>
			<div id="footer">
				<p>
					&copy; 
<?php echo (COPYRIGHT); ?>
					2009
				</p>
			</div>
		</div>
	</body>
</html>
